home *** CD-ROM | disk | FTP | other *** search
/ SGI Enlighten DSM 1.1 / SGI EnlightenDSM 1.1.iso / sol2x / common.z / common / scripts / user.rc
Text File  |  1998-06-30  |  927b  |  52 lines

  1. #
  2. #  Copyright (c) 1990-1998 Enlighten Software Solutions, Inc.
  3. #             -- All Rights Reserved --
  4. #
  5.  
  6. # Arg 1: gecos (realname, telephone, office)
  7. # Arg 2: home directory
  8. # Arg 3: uid
  9. # Arg 4: gid
  10. # Arg 5: shell
  11. # Arg 6: login name
  12.  
  13. # NOTE: if the parameter CREATEHOMEDIR == 0
  14. # then the home directory may not exist when
  15. # this script executes
  16.  
  17. if test -d $2 ; then
  18.     DIR=/etc/skel
  19.  
  20.     if test -d $DIR ; then
  21.         cd $DIR
  22.         for i in local.*
  23.         do
  24.             /bin/cp $i "$2"/`echo $i | /bin/sed -e 's/local//'`
  25.         done
  26.     fi
  27.  
  28.     FILES=`ls -ac $DIR | egrep -v "^local"`
  29.  
  30.     for i in $FILES
  31.     do
  32.         if test "$i" != "." -a "$i" != ".." ; then
  33.             if test ! -f ""$2"/$i" ; then
  34.                 /bin/cp "$i" "$2"
  35.             fi
  36.         fi
  37.     done
  38.  
  39.     if test -n "$OPENWINHOME" ; then
  40.         for i in openwin-init openwin-menu
  41.         do
  42.             if test -f "$OPENWINHOME/lib/$i" ; then
  43.                 if test ! -f "$2"/.$i ; then
  44.                     /bin/cp "$OPENWINHOME/lib/$i" ""$2"/.$i"
  45.                 fi
  46.             fi
  47.         done
  48.     fi
  49. fi
  50.  
  51. exit 0
  52.